package com.dingreading.cloud.soms.service;

import com.dingreading.cloud.common.util.PageUtil;
import com.dingreading.cloud.soms.dto.CmOrderCountDto;
import com.dingreading.cloud.soms.dto.CmorderDto;
import com.dingreading.cloud.soms.entity.Cmorders;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;

import java.util.Date;
import java.util.List;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface CmordersService extends IService<Cmorders> {

    Page<CmorderDto> storePage(
            PageUtil pageUtil, String storeUid, String memberUid, String keyword, String orderType,
            String beginDate, String endDate, Integer status
    );

    Cmorders getByOrderCode(String storeUid, String memberUid, String orderCode);

    CmorderDto getDtoByOrderCode(String storeUid, String memberUid, String orderCode);

    int dropBean(String storeUid, String memberUid, String orderCode);

    boolean updateStatus(String orderCode, Integer status, String statusName);

    boolean updateStatus(String orderCode, Integer status, String statusName, String staffUid, String staffName, String remark);


    boolean updateOrderStateAndChangeDate(String orderCode, String staffUid, String fullName, Integer orderState, String orderStateName, Date changeDate);

    // 统计会员的正价订单数量
    long getMemberNewOrderNum(String storeUid, String memberUid);

    List<CmorderDto> listByOrderCodeInd(List<String> orderCodeList);

    List<Cmorders> exportList(String storeUid, String keyword, String orderType, Integer status, String beginDate, String endDate);

    List<CmorderDto> listByOrderCodeAndRelationCode(String storeUid, String orderCode, String relationCode);

    void unbindReceipt(String storeUid, String orderCode, String receiptUid);

    // 获取25年6月地推99元的订单号
//    List<String> orderCodeListBy250699(String storeUid, String memberUid);

    List<Cmorders> listByMemberUidInAndOrderDate(List<String> memberUidList, String ltOrderDate);

    List<CmOrderCountDto> listByOrderDateBetween(String storeUid, String beginDate, String endDate);
}
